<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@page import="com.cred.industries.platform.business.facade.ForgotPasswordFacade"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>

<%
	response.setHeader("Cache-Control","no-cache"); //forces caches to obtain a new copy of the page from the origin server
	response.setHeader("Cache-Control","no-store"); //directs caches not to store the page under any circumstance
	response.setDateHeader("Expires", 0); //causes the proxy cache to see the page as "stale"
	response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility

	//if the customer id isnt valid it means the updateCustomerBean is not set
	//so we will update it with the customer from the parameters
		
	//get the customer we want to update
	String personaName = ""; 
    if (request.getParameter("personaName") != null) {
    	personaName = request.getParameter("personaName");
    } 
    
	String tempPasswordId = ""; 
    if (request.getParameter("passId") != null) {
    	tempPasswordId = request.getParameter("passId");
    }
    
   	ForgotPasswordFacade forgotPassF = new ForgotPasswordFacade();
   	
   	if(forgotPassF.validateNewPassword(personaName, tempPasswordId))
   	{
   		out.println("Your password has been changed.");
   	}
   	else
   	{
   		out.println("Link has expired or is invalid. Please request a new temporary password");
   	}
%>
</body>
</html>